package edu.yctc.genesis.controller.rest.impl;

import edu.yctc.genesis.controller.rest.UserRestController;
import edu.yctc.genesis.entity.ResultDO;
import edu.yctc.genesis.entity.UserDO;
import edu.yctc.genesis.service.UserIService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ComponentScan({ "edu.yctc.genesis.service" })
@RequestMapping("/restuser")
public class UserRestControllerImpl implements UserRestController {

    @Autowired
    private UserIService userService;

    @Override
    @PostMapping("signup")
    public ResultDO<Void> signup(@RequestBody UserDO userDO) {
        return userService.signup(userDO);
    }
}
